package de.blitzcoder.collide.docs;

import de.blitzcoder.collide.engine.parser.CodeObject;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.ListIterator;

/**
 *
 * @author blitzcoder
 */
public class Module implements Serializable {
    
    private String name;
    private LinkedList<CodeObject> content;
    private Scope parent;

    // ModuleInfo
    private String moduleInfo = "";
    private String history = "";
    
    
    public Module(String name,Scope parent) {
        this.name = name;
        content = new LinkedList<CodeObject>();
        this.parent = parent;
    }

    public Scope getParent() {
        return parent;
    }
    
    public LinkedList<CodeObject> getContent() {
        return content;
    }

    public String getName() {
        return name;
    }
    
    public void addContent(CodeObject obj) {
        content.addLast(obj);
    }
    
    public ListIterator<CodeObject> iterateContent() {
        return content.listIterator();
    }
    
    @Override
    public String toString() {
        return name;
    }
    
    public void addModuleInfo(String str) {
        moduleInfo+=str+"\n";
    }
    
    public String getModuleInfo() {
        return moduleInfo;
    }
    
    public void addHistory(String v) {
        history += v +"\n";
    }
    
    public String getHistory() {
        return history;
    }
    
    
}
